<?php


namespace app\helper;


use app\constant\SubjectConst;

class SubjectHelper
{
    public static function getOrderBySort($sort)
    {
        $order = 'create_time DESC';
        if ($sort == SubjectConst::SORT_TYPE_BY_SALES) {
            $order = 'sales DESC';
        } else if ($sort == SubjectConst::SORT_TYPE_BY_PRICE) {
            $order = 'price ASC';
        }
        return $order;
    }

}